package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.bo.PageCommonParamBo;
import com.cskaoyan.bean.entity.Footprint;
import com.cskaoyan.bean.vo.BasePageData;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.controller.wx.service.FootprintService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <h1> 小程序端 Footprint Controller</h1>
 * Created by GaoJia
 * Date  2021/10/22 14:39
 */
@RestController
@RequestMapping("wx/footprint")
public class WxFootprintController {

    @Resource
    FootprintService footprintService;

    /**
     * <h2> 足迹 列表 </h2>
     */
    @RequestMapping("list")
    public BaseRespVo list(PageCommonParamBo pageParam){
        BasePageData<Footprint> footprints = footprintService.list(pageParam);
        return BaseRespVo.ok(footprints);
    }

    /**
     * <h2> 足迹 删除 </h2>
     */
    @RequestMapping("delete")
    public BaseRespVo detail(Integer id){

        // wx/footprint/detail?id=1046040
        // TODO 拿到请求 与 响应参数
        int i = footprintService.delete(id);
        return BaseRespVo.ok();
    }

}
